package com.zhuojy.equity.mall.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhuojy.equity.mall.admin.common.entity.TRole;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.common.support.Result;
import com.zhuojy.equity.mall.admin.dal.mapper.TRoleMapper;
import com.zhuojy.equity.mall.admin.service.dto.req.CreateRoleReqDTO;
import com.zhuojy.equity.mall.admin.service.dto.req.DeleteRoleReqDTO;
import com.zhuojy.equity.mall.admin.service.dto.req.ModifyRoleReqDTO;
import com.zhuojy.equity.mall.admin.service.dto.res.CreateRoleResDTO;
import com.zhuojy.equity.mall.admin.service.dto.res.DeleteRoleResDTO;
import com.zhuojy.equity.mall.admin.service.dto.res.ModifyRoleResDTO;
import com.zhuojy.equity.mall.admin.service.dto.res.QueryAllRolesResDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 后台角色管理Service实现类
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class RoleService extends ServiceImpl<TRoleMapper, TRole> {


    public Result<CreateRoleResDTO> createRole(CreateRoleReqDTO createRoleReqDTO) {
        return null;
    }

    public Result<ModifyRoleResDTO> modifyRole(ModifyRoleReqDTO modifyRoleReqDTO) {
        return null;
    }

    public Result<DeleteRoleResDTO> deleteRole(DeleteRoleReqDTO deleteRoleReqDTO) {
        return null;
    }


    public ResultEntity queryAllRoles(TRole tRole, Integer pageSize, Integer pageNum) {
        Page<TRole> userPage = new Page<>(pageNum , pageSize);
        IPage<TRole> userIPage =   this.baseMapper.selectFenye(userPage , tRole);
        return ResultEntity.OK(userIPage);

    }
}
